package com.autonavi.yunda.yunji.groovy.test

import com.autonavi.yunda.yunji.core.BaseTest
import com.autonavi.yunda.yunji.core.engine.script.ScriptClassManager
import com.autonavi.yunda.yunji.core.enums.InterfaceStatus
import com.autonavi.yunda.yunji.core.model.condition.InterfaceQueryCondition
import com.autonavi.yunda.yunji.core.model.dto.InterfaceConfigDTO
import com.autonavi.yunda.yunji.core.service.InterfaceConfigService
import com.autonavi.yunda.yunji.core.vo.EngineData
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired

/**
 * @author cizhong.wcs
 * @date 2023/7/28 16:14
 */
class CheckDataTest extends BaseTest {

    @Autowired
    InterfaceConfigService interfaceConfigService

    @Test
    @Disabled
    void engineDataCheck() {
        List<InterfaceConfigDTO> list = interfaceConfigService.list(InterfaceQueryCondition.builder().status(InterfaceStatus.PUBLISHED).build())
        list.forEach { it ->
            {
                EngineData engineData = new EngineData(it.getEngineData());
                ScriptClassManager.checkParams(engineData)
            }
        }
    }
}
